package servlet;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class ForwardServlet1 extends HttpServlet {
    private static final long serialVersionUID = 6831310866438925336L;

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        String path = "WEB-INF/forwarded/result1.jsp";
        // 为请求设置属性
        req.setAttribute("page-path", path);
        // 获取此请求的转发器
        RequestDispatcher dispatcher = req.getRequestDispatcher(path);
        // 转发请求与响应
        dispatcher.forward(req, resp);
    }
}
